<!-- Copyright 2013 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Author:  koto@google.com (Krzysztof Kotowicz)
// Author:  kbsriram@gmail.com (KB Sriram) - a few testcases
// -->
<!DOCTYPE html>
<title>Unit Test of e2e.block.TransferableKey</title>
<script src="../../../../closure/base.js"></script>
<script src="test_js_deps-runfiles.js"></script>
<script>
  goog.require('goog.array');
  goog.require('goog.testing.jsunit');
  goog.require('e2e.openpgp.block.all');
  goog.require('e2e.openpgp.block.factory');
 </script>

<!--
Public key block containing a signing subkey (with binding 0x19 signature)
:public key packet:
  version 4, algo 1, created 1408612889, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:user ID packet: "signing-subkey <signing-subkey@example.com>"
:signature packet: algo 1, keyid 6A69A7100F8C5C47
  version 4, created 1408612889, md5len 0, sigclass 0x13
  digest algo 2, begin of digest e9 eb
  hashed subpkt 2 len 4 (sig created 2014-08-21)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID 6A69A7100F8C5C47)
  data: [1024 bits]
:public sub key packet:
  version 4, algo 1, created 1408612889, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 6A69A7100F8C5C47
  version 4, created 1408612889, md5len 0, sigclass 0x18
  digest algo 2, begin of digest b1 7c
  hashed subpkt 2 len 4 (sig created 2014-08-21)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID 6A69A7100F8C5C47)
  data: [1024 bits]
:public sub key packet:
  version 4, algo 1, created 1408612974, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 6A69A7100F8C5C47
  version 4, created 1408612974, md5len 0, sigclass 0x18
  digest algo 2, begin of digest 93 5a
  hashed subpkt 2 len 4 (sig created 2014-08-21)
  hashed subpkt 27 len 1 (key flags: 02)
  subpkt 16 len 8 (issuer key ID 6A69A7100F8C5C47)
  subpkt 32 len 156 (signature: v4, class 0x19, algo 1, digest algo 2)
  data: [1021 bits]
-->
<textarea id="SigningSubkey">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mI0EU/W6GQEEALr7DpMdrxW2/X1GTepEeABgojRLY7TdGBGR6r7VWzmKh2agQdAC
FyvBcRb/tGwwZmimxyxsws7o+2h3oaM8GL0OQ9WEi1035G5DQweHM989Yw84Dj1O
WeXZxRKAqU93+rEz6xys9BYteqL6SNyNt29EjZ7W+mRtWCRUxViaJhGhABEBAAG0
K3NpZ25pbmctc3Via2V5IDxzaWduaW5nLXN1YmtleUBleGFtcGxlLmNvbT6ItwQT
AQIAIQUCU/W6GQIbAwYLCQgHAwIGFQgCCQoLAxYCAQIeAQIXgAAKCRBqaacQD4xc
R+nrBACSTSve7hlxRONletyvDIeQWewQi6ePXkPGWElPrvf8BjEynDMsJHJiDblO
rv0uvpELS2v+OvzJLGD97arenkfWq7PTp7Lm/CWdrJmvCFTZc2gUyTtxMExre2co
uTpfsUNwZudQwe/n9X9oQ0gAXyT79puJ44SqJ5rB2iQj97YOtbiNBFP1uhkBBACi
80AIcHy8YG2UrfCEy+pThYBJxevsS34ne4jwPQFvQe6XULojujaZ8mUmQ3QeNLhS
oBS6q3zhE/FCSpbjt6IWTmYqXz4gH1AGxCv3kEfUc4s1iVj2/u9lNP7Sh7nzNlFp
mfy59uxn4bS1qXf0K6bVIJMj2T3Aq73bOyk/DWvUqwARAQABiJ8EGAECAAkFAlP1
uhkCGwwACgkQammnEA+MXEexfAQAo7wANLUBF9SMKsoGtMZGgIHXpc27E25Nr2IN
/du5mM7MvJXz7wSU8upw89q2g2LvmpoxMshWfw1hRLR92KIzNEb6HFt/WfIxLBeO
RKLu+kETTWN4cnbU8Rtg8Rvw7OY92/vnvwjv1HXXF2qAbf+Lj0Jy7e6h7C+dAXfS
ZdLlE924jQRT9bpuAQQApdRMs7l2uCQtQOg2qRyoUbQdkaCj+6ON5hvN7swUkLaN
zOT6E0V+mQUjHDbnbS8U3sFEyOwciNvzt1KRKUhsZFN4xaPSYXECw1JQMcZczZ2w
9OOcJrVLpJFrv5cQFrx5X9jfTWePXuC40rXzPZ/RvggSMSlW+dWeFPFA2OYszOkA
EQEAAYkBPQQYAQIACQUCU/W6bgIbAgCoCRBqaacQD4xcR50gBBkBAgAGBQJT9bpu
AAoJEPTeZfMn+FaMeIQD/iNfsKYvRPWHEDcSHL8Cp5Gsf8fshrl4yA7md0SFq627
BtW+wYSBoUE1yuMQhQ64mzMOawvw9kZlYYZuMNmzaY9wtlSe8JpNm0OW10vp7bv3
FNaxBfJa2d+G8wkMPthAbSISd25P6LN1E3szD1IXpnTpY3GMfy1Ed8PFDD5IX26n
k1oD/RBBJp4qH81YpH4PrbBDtliH4xvSHZB/VxAf0AyUmCPj6Mk7SeOFpPayvpMs
ygwBuLvy1JANBI3DLckdmI1tSeOScBpjWqmtWB92U7G3s6bOtyDioDsjBrKzrx8G
RYE/ktdjGkfHqR4TSu7/51yofDGLY1ZHXUp9Kk3PbKWH4Uw5
=8AAO
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Revoked subkey:
:public key packet:
  version 4, algo 1, created 1402245840, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:user ID packet: "revoked <revoked@revoked.net>"
:signature packet: algo 1, keyid 1875FF0B267CDC0E
  version 4, created 1402245840, md5len 0, sigclass 0x13
  digest algo 2, begin of digest c0 34
  hashed subpkt 2 len 4 (sig created 2014-06-08)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID 1875FF0B267CDC0E)
  data: [2047 bits]
:public sub key packet:
  version 4, algo 1, created 1402245840, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 1875FF0B267CDC0E
  version 4, created 1402245876, md5len 0, sigclass 0x28
  digest algo 2, begin of digest b6 9d
  hashed subpkt 2 len 4 (sig created 2014-06-08)
  hashed subpkt 29 len 14 (revocation reason 0x02 (revoke subkey))
  subpkt 16 len 8 (issuer key ID 1875FF0B267CDC0E)
  data: [2047 bits]
:signature packet: algo 1, keyid 1875FF0B267CDC0E
  version 4, created 1402245840, md5len 0, sigclass 0x18
  digest algo 2, begin of digest 1d 4e
  hashed subpkt 2 len 4 (sig created 2014-06-08)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID 1875FF0B267CDC0E)
  data: [2048 bits]
-->
<textarea id="RevokedSubKey">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQENBFOUktABCADNIFjmQ0/u6i2jAtgr0nI/sog7bCXouPSiXvCP2nej7wV7cyJ/
T13GaiWfKMYwLnOKcW9IifOD6qOOOzUThJ5DStq+n2Rs3uSgKiz1GpM6yGJvRSPt
sS3Ww+SOiz383htOZkCNP2LuCHx1e5Dr/m4AP0kDb7ZI5S8Q0aENTVRTyy+eVkUX
mXJf3ZkSOKX0Uij2SSpcLCHfYVeMubF/P2FMwu2Q/XjOGAYsHToI4Yr7IxVVc12y
2es838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YSZrnXQ7KOTJ3QoRwwiF4aOvLAPpsbUQmVo4yGk
bKDuxQdtIl6WK/f/Byd8JaNQffKx6mD5EGVglMIF0w9HMaP1w9Gyu3hRlbwVlFl/
BvyDdGNklm3Zv2v9gZ00W8ZXS1CvDwjl5jRlFxS9ID5x9WtxRF0n93fbCPslQh1s
rpPZJuNpXLKLS1aZhgYvBzHOALMkt9bcdm3pH0lxc8hLhbNQhhEThjvZSbhjCSUl
zzWGE+ZGB04+8M767UzCXXJKC+CRxnWYo2UVKPdWDOjVTA8xXyvI/oSJAR8EGAEC
AAkFAlOUktACGwwACgkQGHX/CyZ83A4dTggAvb8bWddqsuClTNj1uGKo9ilbzPh5
KGNfhtXPh+esCwzDq+2f2n3gWFQK98a5U6PVEINajTrrDcVBwtZbzy0eOwNh4SNv
tPHMi7LW3lWp+c3UziH/9rzKZC9foghoy6StVpt7ceffOUXMt4Ob1P0+Ei/B42xe
VbjYFJxk9Uhl17tfTMSJFTnwB4pouBtUa2+7hRyx9/Tdc04fJDJHzhwz1lZWLg/+
7bICPFJCiiR92WC/Rject5pZt83w3NGmFumYjj2GGujkUdqOnl/gFrRgBwHWo0Ap
1suv4gWhM6uEt/ufhMqmvDwvCOZJrJPa20zg+gErSjPJvARZhZ4OkXhi+w==
=80Vy
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Revoked main key:
// Key generation instruction:
// gpg --gen-key (RSA/RSA/1024 - uid=revoked-main)
// gpg --edit revoked-main
// gpg> revkey, key has been compromised, save, quit
:public key packet:
  version 4, algo 1, created 1408442396, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 44416104FBFEA899
  version 4, created 1408442501, md5len 0, sigclass 0x20
  digest algo 2, begin of digest 19 4c
  hashed subpkt 2 len 4 (sig created 2014-08-19)
  hashed subpkt 29 len 25 (revocation reason 0x02 (Main key revocation test))
  subpkt 16 len 8 (issuer key ID 44416104FBFEA899)
  data: [1024 bits]
:user ID packet: "revoked-main <revoked-main@example.com>"
:signature packet: algo 1, keyid 44416104FBFEA899
  version 4, created 1408442396, md5len 0, sigclass 0x13
  digest algo 2, begin of digest c2 1a
  hashed subpkt 2 len 4 (sig created 2014-08-19)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID 44416104FBFEA899)
  data: [1022 bits]
:public sub key packet:
  version 4, algo 1, created 1408442396, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 44416104FBFEA899
  version 4, created 1408442396, md5len 0, sigclass 0x18
  digest algo 2, begin of digest b4 39
  hashed subpkt 2 len 4 (sig created 2014-08-19)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID 44416104FBFEA899)
  data: [1022 bits]
-->
<textarea id="RevokedMainKey">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mI0EU/MgHAEEALgGq+UDj7R5XwEl3wDzx4M2K3oBJI6ISuc7nJTCbNrcZ2yahAdF
i9Qmunoa8/rryHQZovuBX4QjkZsxorVzFmH+qvaczUYYMsN6vXGKAsPn0OX6AjRs
VesFtqZyi3yW9pLZaCRuikWeUumgJdbFBFS6uoGGwDKK0X1sqajFGIrlABEBAAGI
twQgAQIAIQUCU/MghRodAk1haW4ga2V5IHJldm9jYXRpb24gdGVzdAAKCRBEQWEE
+/6omRlMBACHerNXj6TFIf/h9yjVnL2PmvoMuAVMftVOnXJQq3ikW44Hu9iY+YwX
M6cevKXETAGuEhvKmBAneNUoC0oaQvel5G7VHQTJqlhVRzpv1M/Rqj3879VbGsSh
gmthv8y2lcPRcXvsB0FY/Jxi4v26CcvreYa77efvywuLD+fTaVOY6bQncmV2b2tl
ZC1tYWluIDxyZXZva2VkLW1haW5AZXhhbXBsZS5jb20+iLcEEwECACEFAlPzIBwC
GwMGCwkIBwMCBhUIAgkKCwMWAgECHgECF4AACgkQREFhBPv+qJnCGgP+LvSRVdS4
K+8Ps/LVplD8DP5jDOnMQIHanr85g8RD76gCXD7vqTCaQZbrwRwR43C1g+CB47vJ
l7jToVhjhdGKHKiRxoyF/xwhTDM9LtWA1PwneecoMYTTR4f8dvd+gX/BAOfwahlP
R/CoC8sUflBWb3nezl7mRXpKhVnLxo5DJKC4jQRT8yAcAQQA6xCjxRKKSPxp2lMl
Bd3a+qPtrW32THL7H0dpq+FJ0UiuP78Z6nQ1DWdMFIgQx4SBoBpnTlYNjiG4+XIk
e1WOVvLMpgBTjPHk/BCrweZhHbV/BF97sLxHcqDU40Uf/UUFweEUbVHAD5XrQasz
JmP9EAUUSEDUh/hh5tnPf/avw1sAEQEAAYifBBgBAgAJBQJT8yAcAhsMAAoJEERB
YQT7/qiZtDkD/jCMvfGLZDbw4pjPT/iHTynmltD57X946rqAkOp0mKdyxKS6CbIZ
nR2/cVSIeQoSBWU+qTj52Uw5bWj3uOVvJNfcAPOt7oyYdUJR0WojD7HXYJH9ym0G
/fgSVhEjpq3TDFQQ/s41bw6Nqbnqn+UAdOi97x9ow+zHd2OtVbnCICRE
=VB3i
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
ECC key to check subkey/user id signature verification.
:public key packet:
  version 4, algo 19, created 1377714336, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  keyid: EAEB8A76AFE8C867
:user ID packet: "ecc real name <ecc@example.com>"
:signature packet: algo 19, keyid EAEB8A76AFE8C867
  version 4, created 1377714336, md5len 0, sigclass 0x13
  digest algo 8, begin of digest c6 d7
  hashed subpkt 2 len 4 (sig created 2013-08-28)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID EAEB8A76AFE8C867)
  data: [254 bits]
  data: [254 bits]
:public sub key packet:
  version 4, algo 18, created 1377714336, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  pkey[2]: [32 bits]
  keyid: DBA95B52C1FBBA97
:signature packet: algo 19, keyid EAEB8A76AFE8C867
  version 4, created 1377714336, md5len 0, sigclass 0x18
  digest algo 8, begin of digest 3a 90
  hashed subpkt 2 len 4 (sig created 2013-08-28)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID EAEB8A76AFE8C867)
  data: [256 bits]
  data: [253 bits]
-->
<textarea id="EccKey">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.1.0-ecc (GNU/Linux)

mFIEUh5AoBMIKoZIzj0DAQcCAwT68182duSEJFXKa+qkBa0Vgeswnv8GP8tKYiU/
MCZd6dGTvrtf2gSjyAsVkB0V0idW7i8yW1wfh3y2AbGWDr/dtB9lY2MgcmVhbCBu
YW1lIDxlY2NAZXhhbXBsZS5jb20+iHoEExMIACIFAlIeQKACGwMGCwkIBwMCBhUI
AgkKCwQWAgMBAh4BAheAAAoJEOrrinav6MhnxtcA/iAteDFo/P5SU5XV/8/4BN9x
f28SuvwFipnjjyOmvB0eAP4kPM5LAp2EW+QIyG6+CJP1No9uWyZTdLPkTRgLtYhi
GLhWBFIeQKASCCqGSM49AwEHAgMEgk1dVpgPCM38NBNoBcvehm7mt6aUmK8mDb/M
SHo2/NlwfTh+BDCoVX5asSetzuW2RbnP6sCBwfsuLSrSWUVauwMBCAeIYQQYEwgA
CQUCUh5AoAIbDAAKCRDq64p2r+jIZzqQAQCcv0VOQFiNOM6JNdLHTqlCYxeoz09d
UP3LdgcnLED/YwD9FqcNrkok9BuXJ9+rXTSu+uqdWB7gpMO9mfk65d5IQ+s=
=xRCj
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Revoked one of two user IDs. Both user IDs are additionally signed by a
foreign key.

:public key packet:
  version 4, algo 19, created 1408970397, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  keyid: E3CE624C647B3A23
:user ID packet: "revoked-userid <revoked-userid@example.com>"
:signature packet: algo 19, keyid E3CE624C647B3A23
  version 4, created 1408970568, md5len 0, sigclass 0x30
  digest algo 8, begin of digest 1c f0
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 29 len 27 (revocation reason 0x20 (Revocation because why not))
  subpkt 16 len 8 (issuer key ID E3CE624C647B3A23)
  data: [256 bits]
  data: [255 bits]
:signature packet: algo 19, keyid E3CE624C647B3A23
  version 4, created 1408970397, md5len 0, sigclass 0x13
  digest algo 8, begin of digest 77 ed
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID E3CE624C647B3A23)
  data: [255 bits]
  data: [256 bits]
:signature packet: algo 1, keyid 6A69A7100F8C5C47
  version 4, created 1408970499, md5len 0, sigclass 0x10
  digest algo 2, begin of digest 83 58
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  subpkt 16 len 8 (issuer key ID 6A69A7100F8C5C47)
  data: [1023 bits]
:user ID packet: "non-revoked-uid <non-revoked-uid@example.com>"
:signature packet: algo 19, keyid E3CE624C647B3A23
  version 4, created 1408970478, md5len 0, sigclass 0x13
  digest algo 8, begin of digest b9 c1
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID E3CE624C647B3A23)
  data: [256 bits]
  data: [256 bits]
:signature packet: algo 1, keyid 6A69A7100F8C5C47
  version 4, created 1408970530, md5len 0, sigclass 0x10
  digest algo 2, begin of digest c8 26
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  subpkt 16 len 8 (issuer key ID 6A69A7100F8C5C47)
  data: [1024 bits]
:public sub key packet:
  version 4, algo 18, created 1408970397, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  pkey[2]: [32 bits]
  keyid: 4A5DD549DCAB5055
:signature packet: algo 19, keyid E3CE624C647B3A23
  version 4, created 1408970397, md5len 0, sigclass 0x18
  digest algo 8, begin of digest c3 f7
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID E3CE624C647B3A23)
  data: [256 bits]
  data: [256 bits]
-->
<textarea id="RevokedUserId">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mFIEU/sunRMIKoZIzj0DAQcCAwSRgY4eg7fVp2ILsmsFI4oZ2eXsqgemV7kNGuWa
tA+gmCXTxoLc2IK6PVM+93u4AJObM7Cm/6vJHW95Ohs8cqXWtCtyZXZva2VkLXVz
ZXJpZCA8cmV2b2tlZC11c2VyaWRAZXhhbXBsZS5jb20+iHsEMBMIACMFAlP7L0gc
HSBSZXZvY2F0aW9uIGJlY2F1c2Ugd2h5IG5vdAAKCRDjzmJMZHs6Ixz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GwwACgkQ485iTGR7OiPD9wEAirEelh1tRYGxy1Ghu9NBxLwXhY4BWtNd
NPC1SyXUmj0BAMi7TSyZFM1ETkAJJ1fnRREC1jBFHBBCg2J8Iwt0DCA7
=8vBI
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Key with user attribute packet
:public key packet:
  version 4, algo 19, created 1408973778, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  keyid: D66B9F52D48A1C09
:user ID packet: "user-attr <user-attr@example.com>"
:signature packet: algo 19, keyid D66B9F52D48A1C09
  version 4, created 1408973778, md5len 0, sigclass 0x13
  digest algo 8, begin of digest a2 75
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID D66B9F52D48A1C09)
  data: [256 bits]
  data: [253 bits]
:attribute packet: [jpeg image of size 6078]
:signature packet: algo 19, keyid D66B9F52D48A1C09
  version 4, created 1408973923, md5len 0, sigclass 0x13
  digest algo 8, begin of digest cc 0d
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 2 (pref-zip-algos: 2 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID D66B9F52D48A1C09)
  data: [256 bits]
  data: [256 bits]
:public sub key packet:
  version 4, algo 18, created 1408973778, expires 0
  pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
  pkey[1]: [515 bits]
  pkey[2]: [32 bits]
  keyid: F253FF905C7BE669
:signature packet: algo 19, keyid D66B9F52D48A1C09
  version 4, created 1408973778, md5len 0, sigclass 0x18
  digest algo 8, begin of digest 7e 50
  hashed subpkt 2 len 4 (sig created 2014-08-25)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID D66B9F52D48A1C09)
  data: [256 bits]
  data: [256 bits]
-->
<textarea id="UserAttr">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mFIEU/s70hMIKoZIzj0DAQcCAwRlbqzCg3a6Fmw+Uc9RLYq6W8DjF5K7sm1acR2c
dIg+Y1je9YqgBu5bsTGjMYs+zz2qI9U2l5XAP3rK+w6WsZ6GtCF1c2VyLWF0dHIg
PHVzZXItYXR0ckBleGFtcGxlLmNvbT6IeQQTEwgAIQUCU/s70gIbAwYLCQgHAwIG
FQgCCQoLAxYCAQIeAQIXgAAKCRDWa59S1IocCaJ1AQDPyRUKI5faHbt4anAUQY2Z
aHG1AUMR+rHKtGLFKBtlHgD9GzLvCt4R/IDZJplROykeo1188DSd0MZp8WQM1cqF
GWfR1xHXDwEQAAEBAAAAAAAAAAAAAAAA/9j/4AAQSkZJRgABAQAAAQABAAD/2wCE
AAkGBhIQEBIQDxMQEBAQFRERDxARFhUQFRgUFREXFBQUFRIYHCYfFxsjGRYSHy8g
IycpLCwsFR8xNTAqNSYuLCkBCQoKDgwOGg8PGiskHyQpKi4qKikvKyksLCw0LSwv
KSwqKSwpLCwsKSwsKSwpKSwpLCwsKSkpLCkpLCwsLCwsLP/AABEIAMgA+wMBIgAC
EQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYDBAcBAgj/xABKEAABAwIBBQkN
BQUIAwAAAAABAAIDBBESBQYTITEHFRciQVFScZEUMjNTYXSBkpOxs9HTFjVUodIj
NHKjsiRCYmRzg8HwJZTj/8QAHAEBAAIDAQEBAAAAAAAAAAAAAAM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xpvKMzrSmsMwVkJewtFr6tqjt6X87e0/JTCJOjGbyxCtKCwiIbkl9xrb
2n5KXRFtTpRp9U1nUlPcIiKQjPCFMZyZzS174nzNjaYYmQN0Yc0YWkkE4nHXxj8l
EIsYWcmcvGAiIsmAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgC
IiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiI
gCIiA//ZiHkEExMIACEFAlP7PGMCGwMGCwkIBwMCBhUIAgkKCwMWAgECHgECF4AA
CgkQ1mufUtSKHAnMDQEA34xhJ3Vz7ojwaNNCT452bAx7MpdEfHlfSUYbnVd0NREB
AKT7wkSFYcBkhZBEh01CWyvtIlT9YsEdlmOnoOeSgf+yuFYEU/s70hIIKoZIzj0D
AQcCAwQ0k6t+GWddhqjY+J40mW5h3ehYxntduUhgSiRcaCDxHmAv4WvoIBYXyLtA
e5MjrboHifaLgwM74Em6PMl0k9LfAwEIB4hhBBgTCAAJBQJT+zvSAhsMAAoJENZr
n1LUihwJflABANNtk1A/8KdIydrXdwt5d8QekME4a77TTsIERw4z3hrVAQDm8tPb
GUlOSbBIO0YLTF2/1JxqHAlyk0E+WuNVyii53Q==
=lcS+
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
RSA keys. Only the 2nd subkey should be used for encryption, as noted in the
flags.

pub  1024R/5DDBA594  created: 2014-09-03  expires: never       usage: SCE
                     trust: ultimate      validity: ultimate
sub  1024R/8D9632F1  created: 2014-09-03  expires: never       usage: A
sub  1024R/B6307BCA  created: 2014-09-03  expires: never       usage: E
[ultimate] (1). different-encryption-subkey
    <different-encryption-subkey@example.com>

:public key packet:
  version 4, algo 1, created 1409749099, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:user ID packet: "different-encryption-subkey <different-encryption-subkey@example.com>"
:signature packet: algo 1, keyid D423EB9C5DDBA594
  version 4, created 1409749099, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 73 c6
  hashed subpkt 2 len 4 (sig created 2014-09-03)
  hashed subpkt 27 len 1 (key flags: 0F)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID D423EB9C5DDBA594)
  data: [1023 bits]
:public sub key packet:
  version 4, algo 1, created 1409749141, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid D423EB9C5DDBA594
  version 4, created 1409749141, md5len 0, sigclass 0x18
  digest algo 2, begin of digest b1 8e
  hashed subpkt 2 len 4 (sig created 2014-09-03)
  hashed subpkt 27 len 1 (key flags: 20)
  subpkt 16 len 8 (issuer key ID D423EB9C5DDBA594)
  data: [1024 bits]
:public sub key packet:
  version 4, algo 1, created 1409749184, expires 0
  pkey[0]: [1024 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid D423EB9C5DDBA594
  version 4, created 1409749184, md5len 0, sigclass 0x18
  digest algo 2, begin of digest a0 b4
  hashed subpkt 2 len 4 (sig created 2014-09-03)
  hashed subpkt 27 len 1 (key flags: 0C)
  subpkt 16 len 8 (issuer key ID D423EB9C5DDBA594)
-->
<textarea id="GnuPgKeyUsageFlags">
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)

mI0EVAcQawEEAN3GlVqNbwKGrM3TjUfunatWqY5dzdBPyHMSQAt7tFbH3Mm8AZg7
egdWduEYSBD9GRt89QGDhfjLhPa2YUqemnLXVsqnEYrtthmwidzNOVvb25ItYZSZ
F0EYPk4TCPNLsbzaTC2KaWKNaZ6M0Fl/Oy5qKiUefBFlIR9py7+feelTABEBAAG0
RWRpZmZlcmVudC1lbmNyeXB0aW9uLXN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rF/PPCM5
j/GbY0dnReClicttomuqZKLB3ANeap1s8cmJSinmtL+0lwNUzW/swRX3rw/Fo1Mn
=x53K
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
UID with an expired certification signature.
:public key packet:
  version 4, algo 1, created 1400629566, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:user ID packet: "expired-key"
:signature packet: algo 1, keyid 0B448FF3EF40D052
  version 4, created 1400629566, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 11 65
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 1 (pref-sym-algos: 7)
  hashed subpkt 21 len 1 (pref-hash-algos: 8)
  hashed subpkt 30 len 1 (features: 01)
  critical hashed subpkt 2 len 4 (sig created 2014-05-20)
  critical hashed subpkt 3 len 4 (sig expires after 1d0h0m)
  subpkt 16 len 8 (issuer key ID 0B448FF3EF40D052)
  data: [2047 bits]
:user ID packet: "good-key"
:signature packet: algo 1, keyid 0B448FF3EF40D052
  version 4, created 1409270276, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 9d 08
  hashed subpkt 2 len 4 (sig created 2014-08-28)
  hashed subpkt 27 len 1 (key flags: 2F)
  hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
  hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
  hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
  hashed subpkt 30 len 1 (features: 01)
  hashed subpkt 23 len 1 (key server preferences: 80)
  subpkt 16 len 8 (issuer key ID 0B448FF3EF40D052)
  data: [2046 bits]
-->
<textarea id="ExpiredUid">
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFN76T4BCACA04Pjpjl4i2+5tM/o5p3nFDuYga8ApFgBJHaQkYExYktGqi5j
a9q4DTDCt9j+wJorzBryJuDYA6y32WHY5TPFShBArSZC4rx/ObDFUBRgSP85cQDP
kcAXVmBHH1X3DtB5apgPtrehY3U8O3Ii/yQlTCfXxUVvpVZMYt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PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Subkey with an expired binding signature
:public key packet:
  version 4, algo 1, created 1400631183, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:user ID packet: "expired-subkey"
:signature packet: algo 1, keyid 6CCE47F4114F7C6B
  version 4, created 1409271184, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 59 9c
  hashed subpkt 2 len 4 (sig created 2014-08-29)
  hashed subpkt 27 len 1 (key flags: 03)
  hashed subpkt 11 len 1 (pref-sym-algos: 7)
  hashed subpkt 21 len 1 (pref-hash-algos: 8)
  hashed subpkt 30 len 1 (features: 01)
  subpkt 16 len 8 (issuer key ID 6CCE47F4114F7C6B)
  data: [2047 bits]
:public sub key packet:
  version 4, algo 1, created 1400631183, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid 6CCE47F4114F7C6B
  version 4, created 1400631183, md5len 0, sigclass 0x18
  digest algo 2, begin of digest 64 b2
  hashed subpkt 27 len 1 (key flags: 0C)
  hashed subpkt 2 len 4 (sig created 2014-05-21)
  hashed subpkt 3 len 4 (sig expires after 1d0h0m)
  subpkt 16 len 8 (issuer key ID 6CCE47F4114F7C6B)
  data: [2046 bits]
-->
<textarea id="ExpiredSubkey">
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFN7748BCADlXXWbsunER3lvTHEElkViIq25VGtakZoaLv3q97VYZ0kIW+qQ
06tSu3CzK+JN0tcYBoejry2f/k6mmIW8IB9OAtkTyOLLyC5cL4hyHe49hqFP5wzI
KPaRphO0qAI7WZyxvGjLkVF7mVSoj8Uu6nTSnEtCg3/axxv2Wtrq5aOD9EoikZMP
wZQpqLM0Tw7yCgckOgDHlTd8LV1Ay1bIYWjj3UmdwrTpAq/noKMMj2zXeiXWjUlv
6J664dICjYmv/NcEqzFpz3R9w7ndRhWZtqhLydc/8zI/IY8q/ebsTi+kZaSW5GIg
U5lcZXE/JpyeMPQKqWol5qpUmYWNJqLqA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2Aqc
hx5JIGRQP5teVX0unJCgdLICk2CmqENqMeg7MyMu1/0KoW+FMgBuD9X9HsqLHD1s
l79KGLk9OEwlEPU9k0ejqC6zUDXp+F01zTTBtrkqI0fgOE9hsrc3IMZLmWLgUKvy
59L+
=9yM7
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
Signing subkey that misses a cross-signature
:public key packet:
  version 4, algo 1, created 1394133622, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:user ID packet: "invalid-signing-subkeys"
:signature packet: algo 1, keyid EDD40D05081E923F
  version 4, created 1402773625, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 74 de
  hashed subpkt 2 len 4 (sig created 2014-06-14)
  hashed subpkt 27 len 1 (key flags: 01)
  hashed subpkt 11 len 1 (pref-sym-algos: 7)
  hashed subpkt 21 len 1 (pref-hash-algos: 8)
  hashed subpkt 30 len 1 (features: 01)
  subpkt 16 len 8 (issuer key ID EDD40D05081E923F)
  data: [2046 bits]
:public sub key packet:
  version 4, algo 1, created 1394133622, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid EDD40D05081E923F
  version 4, created 1402773625, md5len 0, sigclass 0x18
  digest algo 2, begin of digest 4c c2
  hashed subpkt 2 len 4 (sig created 2014-06-14)
  hashed subpkt 27 len 1 (key flags: 02)
  subpkt 16 len 8 (issuer key ID EDD40D05081E923F)
  data: [2043 bits]
-->
<textarea id="MissingCrossSignature">
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFMYynYBCACVOZ3/e8Bm2b9KH9QyIlHGo/i1bnkpqsgXj8tpJ2MIUOnXMMAY
ztW7kKFLCmgVdLIC0vSoLA4yhaLcMojznh/2CcUglZeb6Ao8Gtelr//Rd5DRfPpG
zqcfUo+m+eO1co2Orabw0tZDfGpg5p3AYl0hmxhUyYSc/xUq93xL1UJzBFgYXY54
QsM8dgeQgFseSk/YvdP5SMx1ev+eraUyiiUtWzWrWC1TdyRa5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cTyKD6Pkg6wBL3x9/RJye7Zszazm4+toJXZ8xJ3800+BtaPoI39akYJm
+ijzbskvN0v/j5GOFJwQO0pPRAFtdHqRs9Kf4YanxhedB4dIUblzlIJuKsxFit6N
lgGRblagG3Vv2eBszbxzPbJjHCgVLR3RmrVezKOsZjr/2i7X+xLWIR0uD3IN1qOW
CXQxLBizEEmSNVNxsp7KPGTLnqO3bPtqFirxS9PJLIMPTPLNBY7ZYuPNTMqVIUWF
4artDmrG
=7FfJ
-----END PGP PUBLIC KEY BLOCK-----
</textarea>
<!--
SubKey that has an invalid cross-signature
:public key packet:
  version 4, algo 1, created 1394133622, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:user ID packet: "invalid-signing-subkeys"
:signature packet: algo 1, keyid EDD40D05081E923F
  version 4, created 1402773625, md5len 0, sigclass 0x13
  digest algo 2, begin of digest 74 de
  hashed subpkt 2 len 4 (sig created 2014-06-14)
  hashed subpkt 27 len 1 (key flags: 01)
  hashed subpkt 11 len 1 (pref-sym-algos: 7)
  hashed subpkt 21 len 1 (pref-hash-algos: 8)
  hashed subpkt 30 len 1 (features: 01)
  subpkt 16 len 8 (issuer key ID EDD40D05081E923F)
  data: [2046 bits]
:public sub key packet:
  version 4, algo 1, created 1394133622, expires 0
  pkey[0]: [2048 bits]
  pkey[1]: [17 bits]
:signature packet: algo 1, keyid EDD40D05081E923F
  version 4, created 1402773625, md5len 0, sigclass 0x18
  digest algo 2, begin of digest 7b 19
  hashed subpkt 2 len 4 (sig created 2014-06-14)
  hashed subpkt 27 len 1 (key flags: 02)
  hashed subpkt 32 len 284 (signature: v4, class 0x19, algo 1, digest algo 2)
  subpkt 16 len 8 (issuer key ID EDD40D05081E923F)
  data: [2047 bits]
  -->
<textarea id="InvalidCrossSignature">
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFMYynYBCACVOZ3/e8Bm2b9KH9QyIlHGo/i1bnkpqsgXj8tpJ2MIUOnXMMAY
ztW7kKFLCmgVdL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S6NEwHAP20+XjayJ/R3tEA
EQEAAYkCPgQYAQIBKAUCU5ygeQIbAsBdIAQZAQIABgUCU5ygeQAKCRCpVlnFZmhO
52RJB/9uD1MSa0wjY6tHOIgquZcP3bHBvHmrHNMw9HR2wRCMO91ZkhrpdS3ZHtgb
u3/55etj0FdvDo1tb8P8FGSVtO5Vcwf5APM8sbbqoi8L951Q3i7qt847lfhu6sMl
w0LWFvPTOLHrliZHItPRjOltS1WAWfr2jUYhsU9ytaDAJmvf9DujxEOsN5G1YJep
54JCKVCkM/y585Zcnn+yxk/XwqoNQ0/iJUT9qRrZWvoeasxhl1PQcwihCwss44A+
YXaAt3hbk+6LEQuZoYS73yR3WHj+42tfm7YxRGeubXfgCEz/brETEWXMh4pe0vCL
bfWrmfSPq2rDegYcAybxRQz0lF8PAAoJEO3UDQUIHpI/exkH/0vQfdHA8g/N4T6E
i6b1CUVBAkvtdJpCATZjWPhXmShOw62gkDw306vHPilL4SCvEEi4KzG72zkp6VsB
DSRcpxCwT4mHue+duiy53/aRMtSJ+vDfiV1Vhq+3sWAck/yUtfDU9/u4eFaiNok1
8/Gd7reyuZt5CiJnpdPpjCwelK21l2w7sHAnJF55ITXdOxI8oG3BRKufz0z5lyDY
s2tXYmhhQIggdgelN8LbcMhWs/PBbtUr6uZlNJG2lW1yscD4aI529VjwJlCeo745
U7pO4eF05VViUJ2mmfoivL3tkhoTUWhx8xs8xCUcCg8DoEoSIhxtOmoTPR22Z9BL
6LCg2mg=
=Dhm4
-----END PGP PUBLIC KEY BLOCK-----
</textarea>

<script>
function getKey(id) {
  return e2e.openpgp.block.factory.parseAscii(
      document.getElementById(id).value);
}


function testSigningSubkey() {
  var key = getKey('SigningSubkey');
  var mainKeyId = key.keyPacket.keyId;
  var signingSubKey = key.subKeys[1];
  var bindingSig = signingSubKey.bindingSignatures_[0];
  assertArrayEquals(mainKeyId, bindingSig.getSignerKeyId());
  assertTrue(bindingSig.embeddedSignature
      instanceof e2e.openpgp.packet.Signature);
  assertTrue(Boolean(bindingSig.attributes.KEY_FLAG_SIGN));
  var crossSignature = bindingSig.embeddedSignature;
  assertArrayEquals(signingSubKey.keyId, crossSignature.getSignerKeyId());
  assertEquals(e2e.openpgp.packet.Signature.SignatureType.PRIMARY_KEY,
      crossSignature.signatureType);
  key.processSignatures();
  assertEquals(2, key.subKeys.length);
}

function testEmbeddedSignatures() {
  var key, error;
  // Remove embedded signature
  key = getKey('SigningSubkey');
  delete key.subKeys[1].bindingSignatures_[0].embeddedSignature;
  error = assertThrows(function() {
    key.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
  // Tamper signature type
  key = getKey('SigningSubkey');
  key.subKeys[1].bindingSignatures_[0].embeddedSignature.signatureType =
      e2e.openpgp.packet.Signature.SignatureType.SUBKEY;
  error = assertThrows(function() {
    key.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
  // Invalidate signature
  key = getKey('SigningSubkey');
  key.subKeys[1].bindingSignatures_[0].embeddedSignature.signature.s ^= 0x01;
  error = assertThrows(function() {
    key.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
}


function testSignatureVerification() {
  var keyBlock = getKey('EccKey');
  assertEquals(1, keyBlock.subKeys[0].bindingSignatures_.length);
  assertEquals(
      e2e.openpgp.packet.Signature.SignatureType.SUBKEY,
      keyBlock.subKeys[0].bindingSignatures_[0].signatureType);
  assertArrayEquals(
      keyBlock.subKeys[0].bindingSignatures_[0].untrustedAttributes.ISSUER,
      keyBlock.keyPacket.keyId);
  // Modify the signature.
  keyBlock.subKeys[0].bindingSignatures_[0].signature.s ^= 0x01;

  var tamperedAscii = e2e.openpgp.asciiArmor.encode('PUBLIC KEY BLOCK',
      keyBlock.serialize());
  var tamperedKey = e2e.openpgp.block.factory.parseAscii(tamperedAscii);
  var error = assertThrows(function() {
    tamperedKey.processSignatures(); // Signature tampering invalidates the key.
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
}


function testGnupgRevokedSubkey() {
  // Test for https://code.google.com/p/end-to-end/issues/detail?id=60
  // GnuPG places subkey revocation signature packet right after subkey
  // packet.
  var publicKeyBlock = getKey('RevokedSubKey');

  // Parsing revocation signature
  assertEquals(1, publicKeyBlock.subKeys.length);
  var revokedSubkey = publicKeyBlock.subKeys[0];
  assertEquals(1, revokedSubkey.revocations_.length);
  assertEquals(e2e.openpgp.packet.Signature.SignatureType.SUBKEY_REVOCATION,
      revokedSubkey.revocations_[0].signatureType);
  assertEquals(e2e.openpgp.packet.Signature.RevocationReason.KEY_COMPROMISED,
      revokedSubkey.revocations_[0].attributes.REVOCATION_REASON);
  assertEquals('revoke subkey',
      revokedSubkey.revocations_[0].attributes.REVOCATION_REASON_TEXT);
  assertEquals(1, revokedSubkey.bindingSignatures_.length);
  // Applying revocation signature removes the revoked subkey, but the key is
  // still valid.
  publicKeyBlock.processSignatures();
  assertEquals(0, publicKeyBlock.subKeys.length);

  // Tamper revocation signature
  var clone = getKey('RevokedSubKey');
  clone.subKeys[0].revocations_[0].signature.s ^= 0x01;
  var tamperedAscii = e2e.openpgp.asciiArmor.encode('PUBLIC KEY BLOCK',
      clone.serialize());
  var error = assertThrows(function() {
      var key = e2e.openpgp.block.factory.parseAscii(tamperedAscii);
      key.processSignatures(); // Signature tampering invalidates the key.
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
}


function testGnupgRevokedMainKey() {
  var publicKeyBlock = getKey('RevokedMainKey');

  assertEquals(1, publicKeyBlock.keyPacket.revocations_.length);
  assertEquals(e2e.openpgp.packet.Signature.SignatureType.KEY_REVOCATION,
      publicKeyBlock.keyPacket.revocations_[0].signatureType);
  assertEquals(e2e.openpgp.packet.Signature.RevocationReason.KEY_COMPROMISED,
      publicKeyBlock.keyPacket.revocations_[0].attributes.REVOCATION_REASON);
  assertEquals('Main key revocation test',
      publicKeyBlock.keyPacket.revocations_[0].attributes.REVOCATION_REASON_TEXT);
  var error = assertThrows(function() {
      // The whole key is revoked, so this throws error
      publicKeyBlock.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);

  // Tamper revocation signature
  publicKeyBlock.keyPacket.revocations_[0].signature.s ^= 0x01;
  var tamperedAscii = e2e.openpgp.asciiArmor.encode('PUBLIC KEY BLOCK',
      publicKeyBlock.serialize());
  var error = assertThrows(function() {
      var key = e2e.openpgp.block.factory.parseAscii(tamperedAscii)
      key.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
}


function testGnupgRevokedUid() {
  var key = getKey('RevokedUserId');
  var foreignKeyId = [106, 105, 167, 16, 15, 140, 92, 71];
  assertEquals(2, key.userIds.length);
  assertEquals(2, key.userIds[0].certifications_.length);
  assertEquals(2, key.userIds[1].certifications_.length);
  assertEquals(1, key.userIds[0].revocations_.length);
  assertEquals(0, key.userIds[1].revocations_.length);
  // Self-signatures
  assertArrayEquals(key.keyPacket.keyId,
      key.userIds[0].certifications_[0].getSignerKeyId());
  assertArrayEquals(key.keyPacket.keyId,
      key.userIds[1].certifications_[0].getSignerKeyId());
  // Revocation self-signature
  assertArrayEquals(key.keyPacket.keyId,
      key.userIds[0].revocations_[0].getSignerKeyId());
  // Foreign signatures
  assertArrayEquals(foreignKeyId,
      key.userIds[0].certifications_[1].getSignerKeyId());
  assertArrayEquals(foreignKeyId,
      key.userIds[1].certifications_[1].getSignerKeyId());
  // Apply signatures
  key.processSignatures();
  assertEquals(1, key.userIds.length);
  assertEquals(2, key.userIds[0].certifications_.length);
  assertArrayEquals(key.keyPacket.keyId,
      key.userIds[0].certifications_[0].getSignerKeyId());
  assertArrayEquals(foreignKeyId,
      key.userIds[0].certifications_[1].getSignerKeyId());
  assertEquals(0, key.userIds[0].revocations_.length);

  // Check that signature tampering is detected
  key = getKey('RevokedUserId');
  key.userIds[0].revocations_[0].signature.s ^= 0x01;
  assertThrows(function() {
    key.processSignatures();
  });

  // Check that signatures by unknown keys are ignored.
  key = getKey('RevokedUserId');
  key.userIds[0].revocations_[0].untrustedAttributes.ISSUER[0] ^= 0x01;
  key.processSignatures();
  assertEquals(2, key.userIds.length);
};

function testGnupgUserAttr() {
  var key = getKey('UserAttr');
  assertEquals(1, key.userIds.length);
  assertEquals(1, key.userAttributes.length);
  key.processSignatures();
  assertEquals(1, key.userIds.length);
  assertEquals(1, key.userAttributes.length);
  key.userAttributes[0].certifications_ = [];
  // Lack of certification removes User Attribute, but does not throw error.
  key.processSignatures();
  assertEquals(0, key.userAttributes.length);
  // Tampering would throw an error though
  key = getKey('UserAttr');
  key.userAttributes[0].data[0] ^= 0x01;
  var error = assertThrows(function() {
    key.processSignatures();
  });
  assertTrue(error instanceof e2e.openpgp.error.SignatureError);
};

function testKeyUsageFlags() {
  var key = getKey('GnuPgKeyUsageFlags');
  key.processSignatures();
  assertObjectEquals(key.subKeys[1], key.getKeyToEncrypt());
}

function testExpiredUid() {
  var key = getKey('ExpiredUid');
  assertEquals(2, key.userIds.length);
  assertEquals(86400, key.userIds[0].getCertifications()[0].attributes.
      SIGNATURE_EXPIRATION_TIME);
  key.processSignatures();
  // Expired User ID gets rejected
  assertEquals(1, key.userIds.length);
  assertEquals('good-key', key.userIds[0].userId);
}

function testExpiredSubkey() {
  var key = getKey('ExpiredSubkey');
  assertEquals(1, key.subKeys.length);
  assertEquals(86400, key.subKeys[0].getBindingSignatures()[0].attributes.
      SIGNATURE_EXPIRATION_TIME);
  key.processSignatures();
  // Expired User ID gets rejected
  assertEquals(0, key.subKeys.length);
}

function testBadSubkeys() {
  var e = assertThrows(function() {
    getKey('MissingCrossSignature')
  });
  assertTrue(e instanceof e2e.openpgp.error.ParseError);
  assertEquals(e.message, 'Missing required key cross-signature.');
  var key = getKey('InvalidCrossSignature');
  var e = assertThrows(function() {
    key.processSignatures();
  });
  assertTrue(e instanceof e2e.openpgp.error.SignatureError);
  assertEquals(e.message, 'Cross-signature verification failed.');
}

</script>
